import {Story} from "@/dto/Main/Story.ts";
import {BasicApi} from "@/common/BasicApi.ts";
import Result from "@/common/Result.ts";
import PageVo from "@/common/PageVo.ts";
import SelectVo from "@/common/SelectVo.ts";
import axiosRequest from "@/config/axios.ts";

export class StoryApi implements BasicApi<Story,Story,Story>{
    async deleted(sb: Story): Promise<Result<Story>> {
        return await axiosRequest.post<Story,Result<Story>>("/main/story/deleted",sb);
    }

    async deletedAll(sbList: Array<Story>): Promise<Result<Array<Story>>> {
        return await axiosRequest.post<Array<Story>,Result<Array<Story>>>("/main/story/deleted_all",sbList);
    }

    async edit(b: Story): Promise<Result<Story>> {
        return await axiosRequest.post<Story,Result<Story>>("/main/story/edit",b);
    }

    async editAll(bList: Array<Story>): Promise<Result<Array<Story>>> {
        return await axiosRequest.post<Array<Story>,Result<Array<Story>>>("/main/story/edit_all",bList);
    }

    async get(sb: Story): Promise<Result<Story>> {
        return await axiosRequest.post<Story,Result<Story>>("/main/story/get",sb);
    }

    async listAll(sb: Story): Promise<Result<Array<Story>>> {
        return await axiosRequest.post<Story,Result<Array<Story>>>("/main/story/list_all",sb);
    }

    async option(): Promise<Result<Array<SelectVo<string, number, Story>>>> {
        return await axiosRequest.post<Object,Result<Array<SelectVo<string, number, Story>>>>("/main/story/option");
    }

    async pageAll(sb: Story): Promise<Result<PageVo<Story>>> {
        return await axiosRequest.post<Story,Result<PageVo<Story>>>("/main/story/page_all",sb);
    }

}